#include"Fifo.hpp"
#include"Shm.hpp"

int main()
{
    Shm shm(PATH,projid,Type::USER);
    shm.Attr();
   
    FileOper writerfile(PATH, FILENAME);
    writerfile.OpenForWrite();

    //获取共享内存起始
    char *mem=(char*)shm.VirtualAddr();
    int index = 0;
    for (char c = 'A'; c <= 'B'; c++, index += 2)
    {
         // 才是向共享内存写入
         sleep(1);
         mem[index] = c;
         mem[index + 1] = c;
         sleep(1);
         mem[index+2] = 0;
         //写完唤醒服务端
        writerfile.Wakeup();
    }
    return 0;
}